package com.itheima.date8;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Demo04 {

    public static void main(String[] args) {

        LocalDateTime now = LocalDateTime.now();
        String s = now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH时mm分ss秒"));
        System.out.println(s);

        System.out.println("请输入 yyyy年MM月dd日  格式的日期作为生日");
        String s2 = new Scanner(System.in).nextLine();
        System.out.println(s2);
        LocalDate date = LocalDate.parse(s2, DateTimeFormatter.ofPattern("yyyy年MM月dd日"));
        System.out.println(date);


    }
}
